package com.ruoyi.yanjing.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yanjing.mapper.AlertIndicatorMapper;
import com.ruoyi.yanjing.domain.AlertIndicator;
import com.ruoyi.yanjing.service.IAlertIndicatorService;

/**
 * 预警指标Service业务层处理
 * 
 * @author whz
 * @date 2024-12-07
 */
@Service
public class AlertIndicatorServiceImpl implements IAlertIndicatorService 
{
    @Autowired
    private AlertIndicatorMapper alertIndicatorMapper;

    /**
     * 查询预警指标
     * 
     * @param id 预警指标主键
     * @return 预警指标
     */
    @Override
    public AlertIndicator selectAlertIndicatorById(Long id)
    {
        return alertIndicatorMapper.selectAlertIndicatorById(id);
    }

    /**
     * 查询预警指标列表
     * 
     * @param alertIndicator 预警指标
     * @return 预警指标
     */
    @Override
    public List<AlertIndicator> selectAlertIndicatorList(AlertIndicator alertIndicator)
    {
        return alertIndicatorMapper.selectAlertIndicatorList(alertIndicator);
    }

    /**
     * 新增预警指标
     * 
     * @param alertIndicator 预警指标
     * @return 结果
     */
    @Override
    public int insertAlertIndicator(AlertIndicator alertIndicator)
    {
        alertIndicator.setCreateTime(DateUtils.getNowDate());
        return alertIndicatorMapper.insertAlertIndicator(alertIndicator);
    }

    /**
     * 修改预警指标
     * 
     * @param alertIndicator 预警指标
     * @return 结果
     */
    @Override
    public int updateAlertIndicator(AlertIndicator alertIndicator)
    {
        alertIndicator.setUpdateTime(DateUtils.getNowDate());
        return alertIndicatorMapper.updateAlertIndicator(alertIndicator);
    }

    /**
     * 批量删除预警指标
     * 
     * @param ids 需要删除的预警指标主键
     * @return 结果
     */
    @Override
    public int deleteAlertIndicatorByIds(Long[] ids)
    {
        return alertIndicatorMapper.deleteAlertIndicatorByIds(ids);
    }

    /**
     * 删除预警指标信息
     * 
     * @param id 预警指标主键
     * @return 结果
     */
    @Override
    public int deleteAlertIndicatorById(Long id)
    {
        return alertIndicatorMapper.deleteAlertIndicatorById(id);
    }
}
